emacs.git
23 months ago(cl-defstruct): Improve handling of unknown options
Stefan Monnier [Wed, 17 Apr 2024 01:17:47 +0000 (21:17 -0400)]
(cl-defstruct): Improve handling of unknown options

Until now `cl-defstruct` signaled an error when encountering an
unknown option.  It's easy to code and it does the job, but it
doesn't give good location info in the compiler's output,
and it makes it more painful to use not-yet-supported options.
So just signal a warning instead.

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Warn about unknown
options, instead of signaling an error.

23 months ago; Improvements to PEG documentation (second attempt)
Eric Abrahamsen [Tue, 16 Apr 2024 03:14:50 +0000 (20:14 -0700)]
; Improvements to PEG documentation (second attempt)

* doc/lispref/peg.texi: Make more use of defmac/defmacro, and try to
clarify the relationships between the various macros and functions.
* lisp/progmodes/peg.el (peg-parse): Remove claim that PEXS can also be
a single list of rules.

23 months ago* src/xdisp.c (note_fringe_highlight): Another attempt to fix bug#70385.
Eli Zaretskii [Tue, 16 Apr 2024 18:23:37 +0000 (21:23 +0300)]
* src/xdisp.c (note_fringe_highlight): Another attempt to fix bug#70385.

23 months agoMinor fix in detecting recursive redisplay invocations
Eli Zaretskii [Tue, 16 Apr 2024 12:12:42 +0000 (15:12 +0300)]
Minor fix in detecting recursive redisplay invocations

* src/xdisp.c (redisplay_internal): Detect recursive invocations
earlier.  (Bug#66416)

23 months agoRevert "; Improvements to PEG documentation"
Mattias Engdegård [Tue, 16 Apr 2024 09:59:20 +0000 (11:59 +0200)]
Revert "; Improvements to PEG documentation"

This reverts commit 930c578c1042e6372e5433e31b2ea801315c01c9.
Looks like an editing mistake ate a large part of the text.

23 months agoAdapt tree-sitter job on EMBA
Michael Albinus [Tue, 16 Apr 2024 08:55:37 +0000 (10:55 +0200)]
Adapt tree-sitter job on EMBA

* test/infra/gitlab-ci.yml (.tree-sitter-template)
(test-tree-sitter): Adapt tree-sitter job.

23 months agoFix touch screen hscroll when initiated from widgets
Po Lu [Tue, 16 Apr 2024 07:38:53 +0000 (15:38 +0800)]
Fix touch screen hscroll when initiated from widgets

* lisp/wid-edit.el (widget-button--check-and-call-button):
Return to the position of point during the tracking loop if a
touch event is canceled.

23 months agoAnother fix for bug#70385
Po Lu [Tue, 16 Apr 2024 06:54:32 +0000 (14:54 +0800)]
Another fix for bug#70385

* src/xdisp.c (note_fringe_highlight): Test that vpos falls
within W->current_matrix.  (bug#70385)

23 months agoSupport prefix argument for switching tabs in tab-line-mode
Juri Linkov [Tue, 16 Apr 2024 06:40:15 +0000 (09:40 +0300)]
Support prefix argument for switching tabs in tab-line-mode

* lisp/tab-line.el (tab-line-select-tab-buffer): Optimize.
(tab-line-switch-cycling): Enable by default like in tab-bar-mode.
(tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab):
Add a prefix argument ARG and support it for switching tabs.
Improve docstring.

23 months agoAdd font-locking for operators in go-ts-mode (bug#70361)
Noah Peart [Sat, 13 Apr 2024 05:09:17 +0000 (22:09 -0700)]
Add font-locking for operators in go-ts-mode (bug#70361)

* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings): Add
font-locking rule for Go operators.

23 months ago; Improvements to PEG documentation
Eric Abrahamsen [Tue, 16 Apr 2024 03:14:50 +0000 (20:14 -0700)]
; Improvements to PEG documentation

* doc/lispref/peg.texi: Make more use of defmac/defmacro, and try to
clarify the relationships between the various macros and functions.
* lisp/progmodes/peg.el (peg-parse): Remove claim that PEXS can also be
a single list of rules.

23 months ago; Fix last change to secrets-tests.el.
Basil L. Contovounesios [Mon, 15 Apr 2024 21:56:00 +0000 (23:56 +0200)]
; Fix last change to secrets-tests.el.

23 months ago(track-changes-fetch): Fix nested use case
Stefan Monnier [Mon, 15 Apr 2024 20:06:54 +0000 (16:06 -0400)]
(track-changes-fetch): Fix nested use case

* lisp/emacs-lisp/track-changes.el (track-changes-fetch):
Don't presume that if there's nothing to do we're on
`track-changes--clean-trackers`.

23 months ago(track-changes--before): Fix bug#70396
Stefan Monnier [Mon, 15 Apr 2024 19:53:48 +0000 (15:53 -0400)]
(track-changes--before): Fix bug#70396

* lisp/emacs-lisp/track-changes.el (track-changes--before):
Widen the buffer before accessing it with positions
potentially outside the beg..end region.

23 months agoFix resetting the frame's 'frozen_window_starts' flag
Eli Zaretskii [Mon, 15 Apr 2024 13:50:59 +0000 (16:50 +0300)]
Fix resetting the frame's 'frozen_window_starts' flag

* src/window.c (grow_mini_window, shrink_mini_window): Reimplement
how the frame's 'frozen_window_starts' flag is set and reset, to
make sure it is always reset when the mini-window gets to its
normal one-line height.  Patch by Martin Rudalics
<rudalics@gmx.at> (Bug#70038)

23 months agoFix display of @xref documentation in Info
Eli Zaretskii [Mon, 15 Apr 2024 12:47:39 +0000 (15:47 +0300)]
Fix display of @xref documentation in Info

* lisp/info.el (Info--dont-hide-references): New variable.
(Info-fontify-node): Use 'Info--dont-hide-references' to disable
hiding "*Note" or showing "See" instead of it in select nodes.
(Bug#70382)

23 months agoRewrite Android description of Android window management
Po Lu [Mon, 15 Apr 2024 11:54:20 +0000 (19:54 +0800)]
Rewrite Android description of Android window management

* doc/emacs/android.texi (Android Environment): Rewrite several
paragraphs to better reflect recent changes and emphasize
behavior on modern OS releases.

23 months agoMake 'buffer-last-name' work better after 'find-alternate-file' (Bug#68235)
Martin Rudalics [Mon, 15 Apr 2024 09:17:51 +0000 (11:17 +0200)]
Make 'buffer-last-name' work better after 'find-alternate-file' (Bug#68235)

* lisp/files.el (find-alternate-file): Before killing the previous
buffer, try to restore its name and filenames (Bug#68235).

23 months ago; Capitalize 'project' in project-name's docstring
Dmitry Gutov [Sun, 14 Apr 2024 01:22:14 +0000 (04:22 +0300)]
; Capitalize 'project' in project-name's docstring

23 months agoFix bug#70385
Po Lu [Mon, 15 Apr 2024 01:21:17 +0000 (09:21 +0800)]
Fix bug#70385

* src/xdisp.c (note_fringe_highlight): Don't proceed if
popup_activated, window is outdated, or when row beneath pointer
does not display text.  (bug#70385)

23 months agoGC-mark temporary key values created when sorting (bug#69709)
Mattias Engdegård [Sun, 14 Apr 2024 16:20:47 +0000 (18:20 +0200)]
GC-mark temporary key values created when sorting (bug#69709)

Bug reported and fix proposed by Aris Spathis.

* src/sort.c (merge_markmem): Mark heap-allocated temporary key values.
(tim_sort): Delay key function calls to after marking function has been
registered.
* test/src/fns-tests.el (fns-tests-sort-gc): New test.

23 months agoAdd 'forward-sexp-default-function' to be used by 'treesit-forward-sexp'
Juri Linkov [Sun, 14 Apr 2024 16:18:31 +0000 (19:18 +0300)]
Add 'forward-sexp-default-function' to be used by 'treesit-forward-sexp'

* lisp/emacs-lisp/lisp.el (forward-sexp-default-function):
New function with body from 'forward-sexp' (bug#68993).
(forward-sexp-function): Change the default value from nil to
'forward-sexp-default-function'.
(forward-sexp): Use either 'forward-sexp-function' or
'forward-sexp-default-function'.

* lisp/treesit.el (treesit-forward-sexp): In nodes of type 'text'
fall back to 'forward-sexp-default-function'.  Improve docstring.

* doc/lispref/positions.texi (List Motion): Fix pxref.

23 months agotext.texi (Tracking changes): Fix warning
Stefan Monnier [Sun, 14 Apr 2024 16:07:23 +0000 (12:07 -0400)]
text.texi (Tracking changes): Fix warning

* doc/lispref/text.texi (Change Hooks): Add a menu to silence warnings.
(Tracking changes): Improve the title.

23 months ago; * src/eval.c (funcall_lambda): Sink specpdl load out of fast path.
Mattias Engdegård [Sun, 14 Apr 2024 10:47:43 +0000 (12:47 +0200)]
; * src/eval.c (funcall_lambda): Sink specpdl load out of fast path.

23 months ago; * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): less consing
Mattias Engdegård [Sat, 13 Apr 2024 15:43:34 +0000 (17:43 +0200)]
; * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): less consing

23 months agoAdd command 'list-keyboard-macros' that works like 'list-buffers'.
Earl Hyatt [Sun, 24 Mar 2024 15:49:21 +0000 (11:49 -0400)]
Add command 'list-keyboard-macros' that works like 'list-buffers'.

The command 'list-keyboard-macros' allows editing and re-arranging
macros using 'tabulated-list-mode'.  Existing keyboard macros can be
duplicated or deleted.  Macro counters and counter formats can take new
values read from the minibuffer.  Macro keys can be edited using
'edit-kbd-macro'.

* doc/emacs/kmacro.texi (Kmacro Menu): Document the new command
and the menu's commands.
* etc/NEWS (Kmacro Menu Mode): Mention the new mode and command.
* lisp/kmacro.el (kmacro-menu-mark, kmacro-menu-marked)
(kmacro-menu-flagged): Add faces for marks and flags.
* lisp/kmacro.el (kmacro-menu-mode-map, kmacro-menu-mode): Add mode
and map.
* lisp/kmacro.el (list-keyboard-macros, kmacro-menu): Add command.
* lisp/kmacro.el (kmacro-menu--deletion-flags, kmacro-menu--marks)
(kmacro-menu--id-kmacro, kmacro-menu--id-position, kmacro-menu--kmacros)
(kmacro-menu--refresh, kmacro-menu--map-ids, kmacro-menu--replace-all)
(kmacro-menu--replace-at, kmacro-menu--query-revert, kmacro-menu--assert-row)
(kmacro-menu--propertize-keys, kmacro-menu--do-region)
(kmacro-menu--marks-exist-p): Add utility functions of mode
and commands.
* lisp/kmacro.el (kmacro-menu-mark, kmacro-menu-flag-for-deletion)
(kmacro-menu-unmark, kmacro-menu-unmark-backward)
(kmacro-menu-unmark-all): Add commands for marks and flags.
* lisp/kmacro.el (kmacro-menu-do-flagged-delete, kmacro-menu-do-copy)
(kmacro-menu-do-delete): Add commands that modify the ring.
* lisp/kmacro.el (kmacro-menu-edit-position, kmacro-menu-transpose)
(kmacro-menu-edit-format, kmacro-menu-edit-counter)
(kmacro-menu-edit-keys, kmacro-menu-edit-column): Add commands that
modify a keyboard macro.

23 months agoCC Mode: Don't start fontifying in the middle of an identifier
Alan Mackenzie [Sun, 14 Apr 2024 08:21:56 +0000 (08:21 +0000)]
CC Mode: Don't start fontifying in the middle of an identifier

This fixes bug#70367.

* lisp/progmodes/cc-mode.el (c-fl-decl-start): After searching
backwards for the end of the previous statement, check whether
or not we found it.

23 months agoRemove leftover tasks from previous Emacs sessions on startup
Po Lu [Sun, 14 Apr 2024 02:36:50 +0000 (10:36 +0800)]
Remove leftover tasks from previous Emacs sessions on startup

* java/org/gnu/emacs/EmacsService.java (onCreate): Call
removeOldTasks.

* java/org/gnu/emacs/EmacsWindowManager.java (removeOldTasks):
New function.

* java/proguard.conf: Optimize optimizer configuration.

23 months agoRecognize multicite macros from biblatex
Arash Esbati [Sat, 13 Apr 2024 20:31:25 +0000 (22:31 +0200)]
Recognize multicite macros from biblatex

* lisp/textmodes/reftex-cite.el (reftex-all-used-citation-keys):
Match the citation keys used with multicite macros provided by
biblatex.  (bug#38249)

* test/lisp/textmodes/reftex-tests.el
(reftex-all-used-citation-keys): Adjust test accordingly.

23 months agopeg-tests.el: Fix test failures
Stefan Monnier [Sat, 13 Apr 2024 19:35:46 +0000 (15:35 -0400)]
peg-tests.el: Fix test failures

* lisp/progmodes/peg.el (peg-parse): Refine heuristic since unknown
terminals are resolved at run-time rather than compile-time now.
(peg--macroexpand) <stack-action>: Avoid generating a `let` with an
empty body.
(peg--translate-rule-body): Adjust to name change of
`macroexp-warn-and-return` and the fact that it's always available.

* test/lisp/progmodes/peg-tests.el (peg-parse-string):
Add `indent` declaration.
(peg-test): Check that the compiler emits the warnings we expect.

23 months ago(define-globalized-minor-mode): Require the use of `run-mode-hooks`
Stefan Monnier [Sat, 13 Apr 2024 14:31:28 +0000 (10:31 -0400)]
(define-globalized-minor-mode): Require the use of `run-mode-hooks`

When `define-globalized-minor-mode` was introduced (Emacs-22),
`run-mode-hooks` was brand new, so we could not expect all major
modes to use it and we had to rely on brittle workarounds to try
and approximate `after-change-major-mode-hook`.

These workarounds have undesirable side effects, and (we hope)
they're not needed any more now that virtually all major modes
have been changed to use `run-mode-hooks` (or
`define-derived-mode`).

* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Rely only on `after-change-major-mode-hook`, remove the "cmhh"
[typo for the intended "cmmh", BTW] workaround.

* doc/lispref/modes.texi (Mode Hooks): Clarify the importance of
`after-change-major-mode-hook` w.r.t `define-globalized-minor-mode`.
(Defining Minor Modes): Rewrite the explanation of which buffers
are affected, including adjusting it to the fact that
`fundamental-mode` has used run `run-mode-hooks` for last 10 years.

23 months ago(define-globalized-minor-mode): Fix bug#58888
Stefan Monnier [Sat, 13 Apr 2024 14:10:19 +0000 (10:10 -0400)]
(define-globalized-minor-mode): Fix bug#58888

* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode) <MODE-cmhh>:
Try and detect well-behaved modes so they're not affected by
those which require the cmhh hack.

23 months agoMerge branch 'track-changes'
Stefan Monnier [Sat, 13 Apr 2024 13:44:12 +0000 (09:44 -0400)]
Merge branch 'track-changes'

23 months agolisp/emacs-lisp/track-changes.el: New file (bug#70077)
Stefan Monnier [Fri, 5 Apr 2024 21:37:32 +0000 (17:37 -0400)]
lisp/emacs-lisp/track-changes.el: New file (bug#70077)

This new package provides an API that is easier to use right than
our `*-change-functions` hooks.

The patch includes changes to `diff-mode.el` and `eglot.el` to
make use of this new package.

* lisp/emacs-lisp/track-changes.el: New file.
* test/lisp/emacs-lisp/track-changes-tests.el: New file.
* doc/lispref/text.texi (Tracking changes): New subsection.

* lisp/progmodes/eglot.el: Require `track-changes`.
(eglot--virtual-pos-to-lsp-position): New function.
(eglot--track-changes): New var.
(eglot--managed-mode): Use `track-changes-register` i.s.o
`after/before-change-functions` when available.
(eglot--track-changes-signal): New function, partly extracted from
`eglot--after-change`.
(eglot--after-change): Use it.
(eglot--track-changes-fetch): New function.
(eglot--signal-textDocument/didChange): Use it.

* lisp/vc/diff-mode.el: Require `track-changes`.
Also require `easy-mmode` before the `eval-when-compile`s.
(diff-unhandled-changes): Delete variable.
(diff-after-change-function): Delete function.
(diff--track-changes-function): Rename from `diff-post-command-hook`
and adjust to new calling convention.
(diff--track-changes): New variable.
(diff--track-changes-signal): New function.
(diff-mode, diff-minor-mode): Use it with `track-changes-register`.

23 months ago; Additional fixup for truncation of long lines in compilation buffers
Phil Sainty [Sat, 13 Apr 2024 12:49:56 +0000 (00:49 +1200)]
; Additional fixup for truncation of long lines in compilation buffers

* lisp/progmodes/compile.el
(compilation--insert-abbreviated-line): Handle long lines that end
in a newline.  (Bug#70236)

The fix in commit 8f93cba324e4d4022a9422b8c56186213ba2de8d resulted in
the previous "Don't hide the final newline" code causing an off-by-one
error.  With the new code the value of point is what is wanted in both
cases.

23 months ago; Fix coding style of last change to xdisp.c
Po Lu [Sat, 13 Apr 2024 12:07:17 +0000 (20:07 +0800)]
; Fix coding style of last change to xdisp.c

* src/xdisp.c (note_fringe_highlight): Stylistic edits.

23 months agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Eli Zaretskii [Sat, 13 Apr 2024 11:45:59 +0000 (14:45 +0300)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

23 months ago; * src/window.c (shrink_mini_window): Revert inadvertent change.
Eli Zaretskii [Sat, 13 Apr 2024 11:45:15 +0000 (14:45 +0300)]
; * src/window.c (shrink_mini_window): Revert inadvertent change.

23 months agoFix crash upon call to Fset_fontset_font after X server disconnect
Po Lu [Sat, 13 Apr 2024 11:43:40 +0000 (19:43 +0800)]
Fix crash upon call to Fset_fontset_font after X server disconnect

* src/image.c (free_image):

* src/xfaces.c (free_realized_face): Handle scenarios where
free_frame_faces is called with the display connection cut.

* src/xterm.c (x_free_frame_resources): Call free_frame_faces
unconditionally, lest fontsets for this dead frame contaminate
Vfontset_list and produce crashes afterwards.  (bug#66151)

23 months agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 13 Apr 2024 11:37:13 +0000 (07:37 -0400)]
Merge from origin/emacs-29

f0300fb0597 ; Tweak "(emacs)Bug Reference" formatting/wording.
ea62a14ea3b Fix display of vscrolled windows
4cefa3c0b1f ; * doc/emacs/files.texi (Backup): Clarify "saving" (bug#...
db7b571aaaf ; Improve documentation of 'world-clock'
6a0bb7beae3 * doc/emacs/misc.texi (emacsclient Options): Suggest forw...
859b4227e3d Update go-ts-mode to support latest tree-sitter-go grammar
407e85ce139 Fix c++-ts-mode defun navigation (bug#65885)
aca5064f128 ; Fix last change.
55aab2d4710 ; * etc/PROBLEMS: An entry about focus issues with XFCE (...
19cee16576e ; * doc/emacs/misc.texi (emacsclient Options): Fix typo. ...
2a41b6ba514 ; * src/filelock.c (Flock_file): Doc fix (bug#70216).

23 months ago; Fix documentation of last change.
Eli Zaretskii [Sat, 13 Apr 2024 11:20:16 +0000 (14:20 +0300)]
; Fix documentation of last change.

* etc/NEWS:
* doc/lispref/display.texi (Other Display Specs):
* doc/lispref/text.texi (Special Properties): Fix last changes.

23 months agoSupport tooltips for fringe indicators
Vladimir Kazanov [Sun, 24 Dec 2023 11:13:10 +0000 (11:13 +0000)]
Support tooltips for fringe indicators

* src/xdisp.c (note_fringe_highlight): New function.
(note_mouse_highlight): Call it when the mouse is on the fringes.
* src/frame.c (syms_of_frame) <left-fringe-help>
<right-fringe-help>: DEFSYM them.

* etc/NEWS:
* doc/lispref/text.texi (Special Properties):
* doc/lispref/display.texi (Other Display Specs): Document the new
properties.
* etc/TODO: Remove the todo item about this.

23 months ago; Improve documentation of tree-sitter "things"
Eli Zaretskii [Sat, 13 Apr 2024 08:52:57 +0000 (11:52 +0300)]
; Improve documentation of tree-sitter "things"

* doc/lispref/parsing.texi (User-defined Things): Fix text,
punctuation, and markup.
(Tree-sitter Major Modes): Add the missing "things" reference.

* etc/NEWS: Fix "thing"-related entries.

23 months ago; Tweak "(emacs)Bug Reference" formatting/wording.
Basil L. Contovounesios [Sat, 13 Apr 2024 08:36:50 +0000 (10:36 +0200)]
; Tweak "(emacs)Bug Reference" formatting/wording.

23 months agoAllow 'help-quick' to use a non-global keymap
Philip Kaludercic [Thu, 11 Apr 2024 07:00:50 +0000 (09:00 +0200)]
Allow 'help-quick' to use a non-global keymap

* lisp/help.el (help-quick-sections): Mention
'help-quick-use-map' in docstring.
(help-quick-use-map): Add new variable, defaulting to the
global-map.
(help-quick): Use new variable.

23 months ago; Fix typo in 'help-quick-sections' docstring
Philip Kaludercic [Thu, 11 Apr 2024 06:44:46 +0000 (08:44 +0200)]
; Fix typo in 'help-quick-sections' docstring

23 months ago; * src/alloc.c (process_mark_stack): Fix commentary.
Eli Zaretskii [Sat, 13 Apr 2024 08:15:18 +0000 (11:15 +0300)]
; * src/alloc.c (process_mark_stack): Fix commentary.

23 months agoMark Flymake regions more accurately in 'lua-ts-mode'
john muhl [Wed, 13 Mar 2024 13:35:08 +0000 (08:35 -0500)]
Mark Flymake regions more accurately in 'lua-ts-mode'

* lisp/progmodes/lua-ts-mode.el (lua-ts-flymake-luacheck): Use
the end position provided by Luacheck rather than relying on
'thing-at-point' to guess where the end should be.  (Bug#70167)

23 months agoFix Icalendar export with ISO dates
Eli Zaretskii [Sat, 13 Apr 2024 07:52:55 +0000 (10:52 +0300)]
Fix Icalendar export with ISO dates

* lisp/calendar/icalendar.el (icalendar--datestring-to-isodate):
Accept dashes in ISO-style numeric dates.  Patch by Erwan Hingant
<erwan.hingant@mailo.com>. (Bug#69894)

* test/lisp/calendar/icalendar-tests.el
(icalendar--datestring-to-isodate): Add a test for dashes in
ISO-style numeric dates.

23 months agoFix task-switching failures on Android 2.3
Po Lu [Sat, 13 Apr 2024 03:28:23 +0000 (11:28 +0800)]
Fix task-switching failures on Android 2.3

* java/org/gnu/emacs/EmacsWindowManager.java (registerWindow):
Don't specify F_A_MULTIPLE_TASK on Android 4.4 and earlier.

23 months ago(elisp-tests-syntax-propertize): New test for bug#24542
Stefan Monnier [Sat, 13 Apr 2024 01:54:53 +0000 (21:54 -0400)]
(elisp-tests-syntax-propertize): New test for bug#24542

* test/lisp/progmodes/elisp-mode-tests.el (elisp-tests-syntax-propertize):
New test.

23 months agorcs2log now groks add-log-time-zone rule
Paul Eggert [Fri, 12 Apr 2024 20:14:29 +0000 (13:14 -0700)]
rcs2log now groks add-log-time-zone rule

* lib-src/rcs2log (extractTZ): Adjust to renaming of
change-log-time-zone-rule to add-log-time-zone rule, by allowing
either spelling.

23 months ago(emacs-lisp-mode-syntax-table): Fix bug#24542
Stefan Monnier [Fri, 12 Apr 2024 17:28:45 +0000 (13:28 -0400)]
(emacs-lisp-mode-syntax-table): Fix bug#24542

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-syntax-table):
Remove `p` from the flags of `@`.

23 months ago* lisp/buff-menu.el: Improve 'Buffer-menu-group-by-mode' (bug#70150).
Juri Linkov [Fri, 12 Apr 2024 16:39:49 +0000 (19:39 +0300)]
* lisp/buff-menu.el: Improve 'Buffer-menu-group-by-mode' (bug#70150).

(Buffer-menu-group-by): Replace function-item with const
better suitable for Customization UI.
(Buffer-menu-group-by-mode): Use 'mouse-buffer-menu-mode-groups'
to group buffers by mode.

23 months agoNew user option 'tab-line-tabs-buffer-group-function'
Juri Linkov [Fri, 12 Apr 2024 16:35:55 +0000 (19:35 +0300)]
New user option 'tab-line-tabs-buffer-group-function'

* lisp/tab-line.el (tab-line-tabs-buffer-group-function):
Turn defvar into defcustom with the default value
'tab-line-tabs-buffer-group-by-mode'.
(tab-line-tabs-buffer-group-by-mode): New function with body from
'tab-line-tabs-buffer-group-name'.
(tab-line-tabs-buffer-group-by-project): New function.
(tab-line-tabs-buffer-groups): Use fallback name "No group" instead of "All".

23 months ago; * etc/NEWS: Fix typo.
Michael Albinus [Fri, 12 Apr 2024 13:51:26 +0000 (15:51 +0200)]
; * etc/NEWS: Fix typo.

23 months ago; Fix documentation of a recent change in dbus.el (bug#70301)
Eli Zaretskii [Fri, 12 Apr 2024 11:26:27 +0000 (14:26 +0300)]
; Fix documentation of a recent change in dbus.el (bug#70301)

* lisp/net/dbus.el (dbus-string-to-byte-array)
(dbus-byte-array-to-string):
* etc/NEWS:
* doc/misc/dbus.texi (Type Conversion): Fix documentation of these
two D-Bus functions.

23 months ago; Optimize 'completion-preview--try-table'
Eshel Yaron [Thu, 11 Apr 2024 17:16:26 +0000 (19:16 +0200)]
; Optimize 'completion-preview--try-table'

* lisp/completion-preview.el (completion-preview-completion-styles):
New variable.  Default to only include the 'basic' completion style.
(completion-preview--try-table): Let-bind 'completion-styles' when
calling 'completion-all-completions'.  With the default value of
'completion-preview-completion-styles', this yields a significant
performance improvement (up to 4 times faster compared to the
'substring' style when tested with 'elisp-completion-at-point').

Suggested by Ergus <spacibba@aol.com>

23 months agoImprove D-Bus byte-array conversion
Michael Albinus [Fri, 12 Apr 2024 08:09:45 +0000 (10:09 +0200)]
Improve D-Bus byte-array conversion

* doc/misc/dbus.texi (Type Conversion): Adapt dbus-byte-array-to-string.

* etc/NEWS: D-Bus byte array conversion works over raw UTF-8 bytes.
Fix typos.

* lisp/net/dbus.el (dbus-string-to-byte-array)
(dbus-byte-array-to-string): BYTE-ARRAY must be an UTF-8 raw bytes
sequence.  Make optional argument MULTIBYTE obsolete.  (Bug#70301)
(dbus-call-method-handler, dbus-register-signal)
(dbus-escape-as-identifier): Use `length=' and `length>'.

* test/lisp/net/dbus-tests.el (dbus--test-method-handler)
(dbus-test09-get-managed-objects): Use `length='.
(dbus-test01-type-conversion): Extend test.

* test/lisp/net/secrets-tests.el (secrets-test03-items): Extend test.

23 months agoDisplay Info buffer after ensuring it contains text
Joseph Turner [Sat, 6 Apr 2024 01:32:36 +0000 (18:32 -0700)]
Display Info buffer after ensuring it contains text

* lisp/info.el (info-pop-to-buffer): Move display of Info buffer
to a later stage after its text contents is ready to display.
This helps to use fit-window-to-buffer in display-buffer-alist (bug#70213).

23 months ago; Improve documentation of completion commands
Eli Zaretskii [Thu, 11 Apr 2024 18:48:47 +0000 (21:48 +0300)]
; Improve documentation of completion commands

* doc/emacs/mini.texi (Completion Commands): Mention that '?' also
shows a couple of commands.

23 months agominibuffer-completion-help: Fix regression when END < EOB
Dmitry Gutov [Thu, 11 Apr 2024 17:33:16 +0000 (20:33 +0300)]
minibuffer-completion-help: Fix regression when END < EOB

Which can happen with in-buffer completion (though this scenario
is preffed off by default).

* lisp/minibuffer.el (minibuffer-completion-help): Include the
buffer contents after END into BASE-SUFFIX (bug#48356).

23 months agoetags-regen--tags-generate: Handle spaces in project root name
Eli Zaretskii [Thu, 11 Apr 2024 17:09:49 +0000 (20:09 +0300)]
etags-regen--tags-generate: Handle spaces in project root name

* lisp/progmodes/etags-regen.el (etags-regen--tags-generate):
Quote the tags file name (bug#70329).

23 months agoFix file names with embedded whitespace in Ediff
Eli Zaretskii [Thu, 11 Apr 2024 16:14:56 +0000 (19:14 +0300)]
Fix file names with embedded whitespace in Ediff

* lisp/vc/ediff-ptch.el (ediff-patch-file-internal): Quote file
names that can include special characters.  (Bug#70329)

23 months ago; * lisp/bindings.el (mode-line-mode-menu): Add Completion Preview.
Eli Zaretskii [Thu, 11 Apr 2024 16:04:25 +0000 (19:04 +0300)]
; * lisp/bindings.el (mode-line-mode-menu): Add Completion Preview.

23 months agoFix display of vscrolled windows
Eli Zaretskii [Thu, 11 Apr 2024 15:34:53 +0000 (18:34 +0300)]
Fix display of vscrolled windows

* src/xdisp.c (redisplay_window): Fix condition for resetting the
window's vscroll.  (Bug#70038)

23 months agoDon't hide flymake diagnostics on empty first line (bug#70310)
Mattias Engdegård [Thu, 11 Apr 2024 11:55:39 +0000 (13:55 +0200)]
Don't hide flymake diagnostics on empty first line (bug#70310)

A diagnostic first in the buffer, typically the lexical cookie warning,
got lost if that line was empty.

* lisp/progmodes/elisp-mode.el (elisp-flymake--byte-compile-done):
Make sure the location interval doesn't go beyond the buffer bounds.

23 months ago; * etc/NEWS: Group JSON changes.
Mattias Engdegård [Thu, 11 Apr 2024 09:48:40 +0000 (11:48 +0200)]
; * etc/NEWS: Group JSON changes.

23 months ago; * lisp/minibuffer.el (completion-base-suffix): Doc fix (bug#48356).
Eli Zaretskii [Thu, 11 Apr 2024 06:53:34 +0000 (09:53 +0300)]
; * lisp/minibuffer.el (completion-base-suffix): Doc fix (bug#48356).

23 months ago; Fix whitespace in editfns-tests.el
Eli Zaretskii [Thu, 11 Apr 2024 05:55:12 +0000 (08:55 +0300)]
; Fix whitespace in editfns-tests.el

* test/src/editfns-tests.el
(editfns-tests--before/after-change-functions): Fix whitespace.

23 months agoGuarantee presence of emacs-module.h during cross-compilation
Po Lu [Thu, 11 Apr 2024 02:31:17 +0000 (10:31 +0800)]
Guarantee presence of emacs-module.h during cross-compilation

* cross/Makefile.in (src/emacs-module.h): New rule.
(src/libemacs.so): Depend on the same.

23 months agoGuarantee presence of epaths.h during cross-compilation
Po Lu [Thu, 11 Apr 2024 02:25:29 +0000 (10:25 +0800)]
Guarantee presence of epaths.h during cross-compilation

* cross/Makefile.in (src/epaths.h): New rule.
(src/libemacs.so): Depend on the same.

23 months agoOptimize R8 configuration
Po Lu [Thu, 11 Apr 2024 02:15:25 +0000 (10:15 +0800)]
Optimize R8 configuration

* java/org/gnu/emacs/EmacsWindowManager.java (WindowConsumer):
Mark as package-local.

* java/proguard.conf: List only symbols that must be preserved,
enabling R8 to optimize the remainder.

23 months agoAdjust priority of Emacs background service notification
Po Lu [Thu, 11 Apr 2024 01:11:44 +0000 (09:11 +0800)]
Adjust priority of Emacs background service notification

* java/org/gnu/emacs/EmacsService.java (onStartCommand): Reword
lightly and set importance to IMPORTANCE_LOW.

23 months ago; * java/Makefile.in: Render config.status relative to builddir.
Po Lu [Thu, 11 Apr 2024 00:54:08 +0000 (08:54 +0800)]
; * java/Makefile.in: Render config.status relative to builddir.

23 months agoGeneralize the file-name specific workaround in minibuffer-completion-help
Dmitry Gutov [Thu, 11 Apr 2024 00:57:09 +0000 (03:57 +0300)]
Generalize the file-name specific workaround in minibuffer-completion-help

* lisp/minibuffer.el (completion-base-suffix):
New function (bug#48356).
(minibuffer-completion-help): Use it here.
(minibuffer-completion-help): Cut off the double completion
boundary when it occurs inside
completion-list-insert-choice-function..

23 months agoSuppress bogus messages in the echo area
Arash Esbati [Wed, 10 Apr 2024 21:05:39 +0000 (23:05 +0200)]
Suppress bogus messages in the echo area

* lisp/textmodes/reftex-dcr.el (reftex-view-crossref-when-idle):
Check if point inside a mandatory argument where the cite/ref key
usually resides.  For example, with \cite[45]{emacs:30} and point
on 4, the following bogus message in the echo area is suppressed:
"cite: no such database entry: \cite[45]".  (bug#38258)
Fix docstring.

23 months ago; Remove obsolete 'mouse-wheel-up/down-event' bindings
Eshel Yaron [Wed, 10 Apr 2024 19:55:38 +0000 (21:55 +0200)]
; Remove obsolete 'mouse-wheel-up/down-event' bindings

Following commit e720ba62193 'mouse-wheel-up-event' and
'mouse-wheel-down-event' are translated to 'wheel-up/down'
events, so we only need to bind 'wheel-down/up' in
'completion-preview--mouse-map'.

* lisp/completion-preview.el: Don't require 'mwheel'.
(completion-preview--mouse-map): Remove bindings for
'mouse-wheel-up/down-event'.

23 months ago; * doc/emacs/files.texi (Backup): Clarify "saving" (bug#70326).
Eli Zaretskii [Wed, 10 Apr 2024 19:31:57 +0000 (22:31 +0300)]
; * doc/emacs/files.texi (Backup): Clarify "saving" (bug#70326).

23 months ago* doc/lispref/parsing.texi (Parsing Program Source): Fix menu.
Juri Linkov [Wed, 10 Apr 2024 18:07:21 +0000 (21:07 +0300)]
* doc/lispref/parsing.texi (Parsing Program Source): Fix menu.

Add the new node "User-defined Things" to the menu.

23 months ago* lisp/emacs-lisp/comp-cstr.el (comp-cstr-type-p): Improve last change.
Andrea Corallo [Wed, 10 Apr 2024 16:45:47 +0000 (18:45 +0200)]
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-type-p): Improve last change.

23 months ago* lisp/emacs-lisp/comp-cstr.el (comp-cstr-type-p): New function.
Andrea Corallo [Wed, 10 Apr 2024 16:15:12 +0000 (18:15 +0200)]
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-type-p): New function.

23 months ago* lisp/emacs-lisp/comp-cstr.el (comp-cstr-symbol-p): Simplify.
Andrea Corallo [Wed, 10 Apr 2024 16:03:26 +0000 (18:03 +0200)]
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-symbol-p): Simplify.

23 months ago* lisp/emacs-lisp/comp-cstr.el (comp-cstr-fixnum-p): Fix.
Andrea Corallo [Wed, 10 Apr 2024 15:35:08 +0000 (17:35 +0200)]
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-fixnum-p): Fix.

23 months ago(en/decode_coding_object): Fix `after-change-functions`
Stefan Monnier [Wed, 10 Apr 2024 16:15:26 +0000 (12:15 -0400)]
(en/decode_coding_object): Fix `after-change-functions`

For `en/decode-coding-string/region`, `after-change-functions`
were either not run at all, or run only after deleting the text
but not after inserting it.

* src/coding.c (decode_coding_object, encode_coding_object): Run the
after-change-functions after inserting the result.

* test/src/editfns-tests.el (sanity-check-change-functions-with-op):
New macro.
(sanity-check-change-functions-errors): New function.
(editfns-tests--before/after-change-functions): Use them to add
cases for `en/decode-coding-string/region`.

23 months ago* java/Makefile.in (classes.dex): Make proguard.conf relative to srcdir.
Po Lu [Wed, 10 Apr 2024 15:22:38 +0000 (23:22 +0800)]
* java/Makefile.in (classes.dex): Make proguard.conf relative to srcdir.

23 months agoMerge remote-tracking branch 'savannah/master' into master-android-1
Po Lu [Wed, 10 Apr 2024 14:34:02 +0000 (22:34 +0800)]
Merge remote-tracking branch 'savannah/master' into master-android-1

23 months ago* java/proguard.conf: New file.
Po Lu [Wed, 10 Apr 2024 14:33:33 +0000 (22:33 +0800)]
* java/proguard.conf: New file.

23 months agoOptimize generated Android DEX bytecode
Po Lu [Wed, 10 Apr 2024 14:33:08 +0000 (22:33 +0800)]
Optimize generated Android DEX bytecode

* configure.ac (D8): Attempt to locate the bundle where d8 is
installed, detect whether an installation of `r8' is similarly
present, and use this installation in place of d8 if so.

* java/Makefile.in (ANDROID_MIN_SDK, IS_D8_R8): New
substitutions.
(classes.dex): Provide --min-api, --debug or --release and
--pg-conf to d8 or r8.

23 months agoFix 'format-seconds' when all values are zero and %z is used
Eli Zaretskii [Wed, 10 Apr 2024 14:00:34 +0000 (17:00 +0300)]
Fix 'format-seconds' when all values are zero and %z is used

* lisp/calendar/time-date.el (format-seconds): Fix all-zero time.

* test/lisp/calendar/time-date-tests.el (test-format-seconds): Add
two new tests.  (Bug#70322)

23 months ago; Improve documentation of 'world-clock'
Eli Zaretskii [Wed, 10 Apr 2024 13:52:21 +0000 (16:52 +0300)]
; Improve documentation of 'world-clock'

* lisp/time.el (zoneinfo-style-world-list)
(legacy-style-world-list): Doc fixes.

23 months ago* lisp/emacs-lisp/cl-macs.el (cl-typep): Add docstring.
Andrea Corallo [Wed, 10 Apr 2024 13:27:46 +0000 (15:27 +0200)]
* lisp/emacs-lisp/cl-macs.el (cl-typep): Add docstring.

23 months ago* doc/emacs/misc.texi (emacsclient Options): Suggest forwarding sockets.
Peter Oliver [Wed, 10 Apr 2024 08:42:39 +0000 (10:42 +0200)]
* doc/emacs/misc.texi (emacsclient Options): Suggest forwarding sockets.

(Bug#66667)

23 months agoUpdate go-ts-mode to support latest tree-sitter-go grammar
Yuan Fu [Tue, 9 Apr 2024 03:20:25 +0000 (20:20 -0700)]
Update go-ts-mode to support latest tree-sitter-go grammar

tree-sitter-go changed method_spec to method_elem in
https://github.com/tree-sitter/tree-sitter-go/commit/b82ab803d887002a0af11f6ce63d72884580bf33

* lisp/progmodes/go-ts-mode.el:
(go-ts-mode--method-elem-supported-p): New function.
(go-ts-mode--font-lock-settings): Conditionally use method_elem or
method_spec in the query.

23 months agoRecognize Android TLS certificates by default
Po Lu [Wed, 10 Apr 2024 04:12:33 +0000 (12:12 +0800)]
Recognize Android TLS certificates by default

* lisp/net/gnutls.el (gnutls-trustfiles): Append directories
holding system and user-provided certificates on Android.

23 months ago(cl--describe-class-slots): Avoid cryptic `t` type
Stefan Monnier [Tue, 9 Apr 2024 22:33:01 +0000 (18:33 -0400)]
(cl--describe-class-slots): Avoid cryptic `t` type

* lisp/emacs-lisp/cl-extra.el (cl--describe-class-slots): Use the empty
string for the trivial `t` type.

* lisp/emacs-lisp/cl-preloaded.el (cl-structure-class):
Fix non-existing `bool` => `boolean`.

23 months ago; Minor copy edits
Dmitry Gutov [Tue, 9 Apr 2024 19:40:14 +0000 (22:40 +0300)]
; Minor copy edits

23 months agoAdd Flymake backend to rust-ts-mode using Clippy
Dmitry Gutov [Tue, 9 Apr 2024 19:39:32 +0000 (22:39 +0300)]
Add Flymake backend to rust-ts-mode using Clippy

* lisp/progmodes/rust-ts-mode.el (rust-ts-flymake-command):
New option (bug#70260).
(rust-ts--flymake-proc): New variable.
(rust-ts-flymake--helper): New function.
(rust-ts-flymake): New function.
(rust-ts-mode): Add it to flymake-diagnostic-functions.

23 months ago(test-replace-match-modification-hooks): Delete test
Stefan Monnier [Tue, 9 Apr 2024 15:01:36 +0000 (11:01 -0400)]
(test-replace-match-modification-hooks): Delete test

* test/src/search-tests.el (test-replace-match-modification-hooks):
Delete, this is testing a functionality we can't really support.

23 months agoMerge branch 'mouse-wheel-buttons'
Stefan Monnier [Tue, 9 Apr 2024 14:28:05 +0000 (10:28 -0400)]
Merge branch 'mouse-wheel-buttons'